﻿using System;
using System.Configuration;

namespace GoogleMaps.Configuration
{
	/// <summary>
	/// A custom configuration section used to control some of the Google Maps Control behavior.
	/// </summary>
	public class GoogleMapsSection : System.Configuration.ConfigurationSection
	{
		private const String SECTION_NAME = "googleMaps";

		/// <summary>
		/// Gets or sets the ApiKey that has been issued from Google.
		/// </summary>
		[ConfigurationProperty("apiKey", IsRequired=true)]
		public string ApiKey
		{
			get { return (string)this["apiKey"]; }
			set { this["apiKey"] = value; }
		}


		/// <summary>
		/// A helper method to get the instance of this configuration section from the app.config file.
		/// </summary>
		/// <returns>The DataSettingsSection that is conifguration in the app.config file.</returns>
		internal static GoogleMapsSection Section
		{
			get
			{
				return (GoogleMapsSection)ConfigurationManager.GetSection(SECTION_NAME);
			}
		}
	}
}
